package personal.leil.learning;

/**
 * 双链表节点
 * <p>
 *     双链表节点代码实现
 * </p>
 * @author Leil
 * @version 1.0
 * @since 2024-1-5
 */
public class DNode {

    /**
     * 指向下一节点的指针
     */
    private DNode next;

    /**
     * 指向上一节点的指针
     */
    private DNode prev;

    /**
     * 数据域
     */
    private Object data;

    /**
     * Constructor
     * @param data  data for node
     */
    public DNode(Object data) {
        this.data = data;
    }

    public Object getData() {
        return data;
    }

    public DNode getPrev() {
        return prev;
    }

    public void setPrev(DNode prev) {
        this.prev = prev;
    }

    public DNode getNext() {
        return next;
    }

    public void setNext(DNode next) {
        this.next = next;
    }
}
